import orm
def login():
    name=input("请输入您的用户名：")
    password=input("请输入您的密码：")
    tag=0
    sql=f'''
    select * from t1 where name='{name}' and password='{password}'
'''
    data= orm.read_data(sql)
    if data!=():
        tag=1
        return tag

def register():
    name=input("请输入要注册的用户名：")
    pwd=input("请输入密码：")
    # rows=0
    tag=0
    sql=f"""
    insert into t1 values(null,'{name}','{pwd}')
"""
    rows= orm.write_data(sql)
    if rows>0:
        tag=1
    return tag
if __name__ == '__main__':
    # assert()
    # print(assert())
    register()
    # print(register())
